package dao

import (
	"gorm.io/gorm"
	"kamibako.ltd/go-essential/internal/initialize"
	"kamibako.ltd/go-essential/internal/model"
)

var User = UserDAO{}

type UserDAO struct {}

func DB() *gorm.DB {
	return initialize.DB
}

func (dao *UserDAO) GetUserById(id int) (user model.User, err error) {
	err = DB().First(&user).Where("user_id = ?", id).Error
	return
}